package gui.menu;

import java.awt.Dimension;

import javax.swing.JButton;
import javax.swing.JPanel;

/**
 * View for the "in game" Panel menu view
 * @author Qw4z1
 *
 */
@SuppressWarnings("serial")
public class PanelMenuView extends JPanel {
	private static PanelMenuView me;
	protected JButton connectToServerButton;
	protected JButton startServerButton;
	protected JButton exitButton;
	private JPanel jpanel1;
	
	public static PanelMenuView getInstance(){
		if(me == null)
			me = new PanelMenuView();
		return me;
	}
	
	public PanelMenuView(){
		initComponents();

	}
	
	public void initComponents(){
		
		jpanel1 = new JPanel();
		exitButton = new JButton("Exit");
		startServerButton = new JButton("Start server!");
		connectToServerButton = new JButton("Connect to server");
		this.add(jpanel1);
		jpanel1.setPreferredSize(new Dimension(150, 300));
		jpanel1.setSize(150, 300);

		//Add buttons
		jpanel1.add(startServerButton);
		jpanel1.add(connectToServerButton);
		jpanel1.add(exitButton);


		
		//Add listener
		startServerButton.addActionListener(new PanelMenuController());
		exitButton.addActionListener(new PanelMenuController());
		connectToServerButton.addActionListener(new PanelMenuController());
		
	}


}
